package com.dingding.transfer.stamper.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dingding.transfer.stamper.entity.ProcessRecord;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author wangxiyuan
 * @description
 * @createDate 2021/3/31 10:40
 **/
public interface ProcessRecordDao extends BaseMapper<ProcessRecord> {
    @Select(value = "select * from process_record where process_id=#{processId} order by process_time desc")
    List<ProcessRecord> findLastestRecord(String processId);

    @Update(value = "update process_record set status=#{status},process_time=#{processTime} where serial_id=#{serialId}")
    void updateRecord(ProcessRecord record);

    @Select(value = "select distinct userid from process_record where apply_id=#{applyId}")
    List<String> getApproveOper(int applyId);
}
